module ActionView
  module Helpers
    module UrlHelper
      alias_method :ror_link_to, :link_to
    
     def link_to(name, options = {}, html_options = nil, *params)
        if controller.access_approved?(options[:controller], options[:action], options[:id])
          return ror_link_to(name,options,html_options,*params) 
        end
        return ""
      end

      def links(link_array)
        rvalue = ""
        link_array.each{|link| rvalue << link << " | " if link.length > 0 }
        rvalue.chop.strip
      end
    
      def ca(ctroller, action, id = nil)
        return {:controller => ctroller, :action => action} if id.nil?
        return {:controller => ctroller, :action => action, :id => id}
      end
     end 
  end
end
